<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/cardinfo.css"/>

    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrapSwitch.css">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/addmchat.css"/>
    <link rel="stylesheet" href="__STATIC_URL__/static/css/coupon.css"/>
    <link rel="stylesheet" href="__STATIC_URL__/static/css/creatcard.css?v=1"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/fonts/css/font-awesome.css?v=3"/>
    <style>
        .checkbox input[type="checkbox"]:checked + label::after {
            content: "\f00c";
            font-family: 'FontAwesome';
        }
        .checkbox label::after {
            width: 16px;
            height: 16px;
            left: -1px;
            top: -1px;
             background: none;
        }
    </style>
    <script>
        var getcardusAPI = "{:url('')}";
        var getmchAPI = "{:url('cardstest/getmachlist')}";
        var baseUrl = function GetRequest() {
            var url = window.location.href;  //获取url中"?"符后的字符串
            var card_id = url.split('/').pop().replace(/\.html/, '')
            // console.log(card_id)

            return card_id;
        }
        var card_id = baseUrl();

    </script>
    <style>

    </style>
</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section>
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>当前位置是&nbsp;:</li>
                <li>
                    <a href="{:url('cards/cardslist')}">卡券管理</a>
                </li>
                <li>
                    <a href="javascript:history.back();">卡券列表</a>
                </li>
                <li class="active" style="color: #02b87f;">添加卡券</li>
            </ul>
        </div>
        <div class="panel mgr15 mgl15">
            <div class="panel-heading addCharts" style="background:#ededed;">
                卡券
            </div>
            <div class="panel-body">
                <div class="panel panel-default" id="step1">
                    <div class="panel-body" id="app_cardus">

                        <div class="card_preview_area card-left" >
                            <div class="media_preview_area" id="js_preview_area" >
                                <div class="msg_card js_color_preview card_section" :style="{background:color}" >
                                    <div class="msg_card_inner js_color_preview card_section" :style="{background:color}" >
                                        <p class="msg_title js_color_preview " style="margin: 0px;"></p>
                                        <div class="js_preview js_color_preview msg_card_section shop disabled focus itemdiv card_section" :style="{background:color}" >

                                            <div class="shop_panel" id="color-purview" style=" height: auto; margin-bottom: -15px; ">
                                                <div class="logo_area group">
                                        <span class="logo l" id="logo">
                                            <img v-bind:src="logopic" class="logopic" style="margin:0;">
                                        </span>
                                                    <br>
                                                    <p id="brand_name_preview" class="js_title_preview brand_name">{{brand_name}}</p>
                                                </div>
                                                <div class="msg_area">
                                                    <div class="tick_msg">
                                                        <p id="js_title_preview" class="kqmc card_name">{{card_name}}</p>
                                                        <p id="sub_title_preview" class="cardtips"></p>
                                                        <p class="ljsy" :style="{background:color}"  style="border-radius: 3px;color: #fff;padding: 8px 35px;width: 50%;margin: 0 auto;">
                                                            立即使用
                                                        </p>
                                                        <div class="clear"></div>
                                                    </div>
                                                </div>

                                            </div>

                                            <div class="fengmian_img_parent hide" style="position: relative;padding-bottom: 0px;">
                                                <img src="" style="width: 100%;height: 125px;" class="fengmian_img_dom">
                                                <div id="cover-pre">
                                                    <span id="cover-text" class="coverAbstract" >{{abstract}}</span>
                                                    <i class="ion-ios7-arrow-right"></i>
                                                </div>
                                            </div>
                                            <div class="msg_card_cell shop_detail last_cell" >
                                                <ul class="list">
                                                    <li class="msg_card_section js_preview give-friend-pre " id="quick_pay" v-show="quick_pay">
                                                        <div class="li-panel area">
                                                            <div class="li_content"><p>转赠给朋友</p></div>
                                                            <span class="ricon glyphicon glyphicon-chevron-right"></span>
                                                            <div class="cicon">
                                                                <a href="javascript:;" data-id="form2"><i class="fa fa-pencil"></i></a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="li-panel area">
                                                            <div class="li-content" id="card">{{type_name}}</div>
                                                            <span class="ricon glyphicon glyphicon-chevron-right"></span>
                                                            <div class="cicon">
                                                                <a href="javascript:;" data-id="form3"><i class="fa fa-pencil"></i></a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="li-panel area">
                                                            <div class="li-content">公众号</div>
                                                            <span class="ricon glyphicon glyphicon-chevron-right"></span>
                                                            <div class="cicon">
                                                                <a href="javascript:;" data-id="form4"><i class="fa fa-pencil"></i></a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="alert form form-area" style="position: relative;margin-left:370px;display: block; margin-top: 0.5px;" id="form1">
                            <div class="arrow_in"></div>
                            <h4  class="card_title_detail">基本信息</h4>
                            <div class="form-horizontal form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label"> 卡券类型：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                <div class="btn-group" id="quan-type">
                                    <button  v-for="(vos,key) in typeList" @click="tabstype(key,vos.name)" class="btn btn-default " v-bind:class="{active:vos.name==isActive}">{{vos.title}}</button>

                                </div>
                            </div>
                            <form class="form-horizontal adminex-form" action="" id="deitcard" method="post">
                                <input type="hidden" name="id" :value="cid">


                                <input type="hidden" name="method" value="editdrafts">
                                <input type="hidden" name="logourl" :value="logopic">
                                <input type="hidden" name="service_phone" :value="service_phone">
                                <input type="hidden" name="type" id="type" :value="type">
                                <input type="hidden" name="is_card_xs" value="2">
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">门店：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12">
                                        <input type="text" class="form-control" id="brand_names" :value="brand_name"   disabled>
                                        <input type="hidden" name="mid" :value="mid" >
                                        <div class="text-danger">只显示已授权微信公众号的门店</div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">卡券名称：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12">
                                        <input type="text" class="form-control" name="title" id="kqmc" @input = "settitle"  v-model="title"  onchange="tex('kqmc','titletext','9');">
                                        <div class="help-block" id="titletext" ></div>
                                        <div class="help-block">例如：5元代金券 ,字数上限为9个汉字。</div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                                        背景颜色：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span>
                                    </label>
                                    <div class="col-sm-9 col-xs-12">
                                        <div class="cover" id="colors">
                                            <input type="hidden" name="color" :value="color">
                                            <ul class="color-list clearfix">
                                                <li  v-for="(vos,key) in colorList" @click="colortype(key,vos.color)" v-bind:class="{selected:vos.color==iscolor}" :style="{background:vos.color}"  ></li>

                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group" id="hurry_wrap" v-show="hurry_wrap">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">开启立减金额：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <div class="controls">
                                            <div class="switch" id="hurry">
                                                <input type="checkbox" :checked="check==card.is_minus"/>
                                                <input type="hidden" name="is_minus" id="can_hurry" value="0">
                                            </div>
                                            <div class="help-block col-sm-12 col-xs-12" style="padding: 0;">
                                                开启后请前往营销工具，社交立减金中设置。
                                                <br>
                                                开启后下方开始时间必须大于当前时间。
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group hidden" id="create_mid_wrap" v-show="hurry_wrap">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户号：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12">


                                        <input type="text" class="form-control" name="create_mid" :value="create_mid" placeholder=""  id="create_mid">
                                        <div class="help-block">输入已配置appid的微信支付商户号。 </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">功能开关：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <div class="checkbox checkbox-primary permanent" style="top: 4px;display: inline-block;" data-toggle="tooltip"  title="开启后可在营销工具,付费卷中设置。">
                                            <input type="hidden" name="is_pay" :value="card.is_pay" id="is_pay">
                                            <input id="pay" type="checkbox" class="autoDelayFlag" :checked="check==card.is_pay">
                                            <label for="pay">是否为付费</label>
                                        </div>
                                        <div class="checkbox checkbox-primary permanent" style="top: 4px;display: inline-block;" data-toggle="tooltip"  title="开启后可在会员卡,储值管理,添加面额中设置。">
                                            <input type="hidden" name="is_cgive" :value="card.is_cgive" id="is_cgive">
                                            <input id="cgive" type="checkbox" class="autoDelayFlag" :checked="check==card.is_cgive">
                                            <label for="cgive">是否参与充送</label>
                                        </div>
                                        <div class="checkbox checkbox-primary permanent" style="top: 4px;display: inline-block;" data-toggle="tooltip"  title="开启后可在手机微信端卡券里分享。">
                                            <input type="hidden" name="can_share" :value="card.can_share" id="can_share">
                                            <input id="share" type="checkbox" class="autoDelayFlag" :checked="check==card.can_share">
                                            <label for="share">是否可分享</label>
                                        </div>
                                        <div class="checkbox checkbox-primary permanent" style="top: 4px;display: inline-block;" data-toggle="tooltip"  title="开启后可在手机微信端卡券里转送。">
                                            <input type="hidden" name="can_give_friend" :value="card.can_give_friend" id="can_give_friend">
                                            <input id="give" type="checkbox" class="autoDelayFlag" :checked="check==card.can_give_friend">
                                            <label for="give">是否可转赠</label>
                                        </div>


                                    </div>
                                </div>
                                <!--<div class="form-group">-->
                                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否为付费：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>-->
                                    <!--<div class="col-sm-9 col-xs-12 coupon-color">-->
                                        <!--<div class="controls">-->

                                            <!--<div class="switch" id="pay">-->
                                                <!--<input type="checkbox" :checked="check==card.is_pay"/>-->
                                            <!--</div>-->
                                            <!--<input type="hidden" name="is_pay" id="is_pay" :value="card.is_pay">-->

                                            <!--<div class="help-block col-sm-12 col-xs-12" style="padding: 0;">开启后可在营销工具,付费卷中设置。  </div>-->

                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否参与充送：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>-->
                                    <!--<div class="col-sm-9 col-xs-12 coupon-color">-->
                                        <!--<div class="controls">-->
                                            <!--<div class="switch" id="cgive">-->
                                                <!--<input type="checkbox" :checked="check==card.is_cgive"/>-->
                                                <!--<input type="hidden" name="is_cgive" id="is_cgive" :value="card.is_cgive">-->
                                            <!--</div>-->
                                            <!--<div class="help-block col-sm-12 col-xs-12" style="padding: 0;">开启后可在会员卡,储值管理,添加面额中设置。  </div>-->

                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否可分享：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>-->
                                    <!--<div class="col-sm-9 col-xs-12 coupon-color">-->
                                        <!--<div class="controls">-->
                                            <!--<div class="switch" id="share">-->
                                                <!--<input type="checkbox" :checked="check==isshuju.can_share"/>-->
                                                <!--<input type="hidden" name="can_share" id="can_share" :value="isshuju.can_share">-->
                                            <!--</div>-->
                                            <!--<div class="help-block col-sm-12 col-xs-12" style="padding: 0;">开启后可在手机微信端卡券里分享。  </div>-->

                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否可转赠：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>-->
                                    <!--<div class="col-sm-9 col-xs-12 coupon-color">-->
                                        <!--<div class="controls">-->
                                            <!--<div class="switch" id="give">-->
                                                <!--<input type="checkbox" :checked="check==isshuju.can_give_friend"/>-->
                                                <!--<input type="hidden" name="can_give_friend" id="can_give_friend" :value="isshuju.can_give_friend">-->


                                            <!--</div>-->
                                            <!--<div class="help-block col-sm-12 col-xs-12" style="padding: 0;">开启后可在手机微信端卡券里转送。  </div>-->
                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否在卡券中心显示：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>-->
                                <!--<div class="col-sm-9 col-xs-12">-->
                                <!--<select name="is_card_xs" class="form-control" >-->
                                <!--<option value="2">隐藏</option>-->
                                <!--<option value="1">显示</option>-->
                                <!--</select>-->
                                <!--<div class="text-danger"></div>-->
                                <!--</div>-->
                                <!--</div>-->

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">领取限制：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <div class="clearfix">
                                            <input type="hidden" :value="use_limit" class="form-control pull-left" name="use_limit" id="use_limit" style="width: 200px;" >

                                            <input type="text"  @input = "setget_limit"  v-model="get_limit" class="form-control pull-left" name="get_limit" id="get_limit" style="width: 200px;" >                                            <span class="pull-left" style="padding-top:4px">张</span>
                                        </div>
                                        <div class="help-block col-sm-12 col-xs-12" style="padding: 0;">每人可领取的数量限制，建议每人限领一张  </div>
                                    </div>
                                </div>
                                <!--<div class="form-group">-->
                                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">使用限制：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>-->
                                    <!--<div class="col-sm-9 col-xs-12 coupon-color">-->
                                        <!--<div class="clearfix">-->
                                            <!--<input type="text" :value="card.use_limit" class="form-control pull-left" name="use_limit" id="use_limit" style="width: 200px;" >-->
                                            <!--<span class="pull-left" style="padding-top:4px">张</span>-->
                                        <!--</div>-->
                                        <!--<div class="help-block col-sm-12 col-xs-12" style="padding: 0;">每人可使用的数量，建议每人限用一张（使用限制推荐等于领取限制）  </div>-->
                                    <!--</div>-->
                                <!--</div>-->

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">有效期：<span
                                            class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                                            <span class="radio ng-scope radio-inline" onclick="settimes(this,'date_info');">
                                                     <input name="date_info" type="radio" :checked="timeradio1==card.time_type" value="DATE_TYPE_FIX_TIME_RANGE">
                                                     <label class="ng-binding">固定日期</label>
                                            </span>
                                            </label>
                                            <div class="col-sm-6 col-xs-6 coupon-time">
                                                <input type="text" name="times"  :disabled="timeradio1!==card.time_type" class="form-control"  :value="card.times" placeholder="请选择开始时间"  id="starttime">
                                                <div class="r-message text-danger"></div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">

                                            <span class="radio ng-scope radio-inline"  onclick="settimes(this,'date_info');">
                                                      <input name="date_info" type="radio" :checked="timeradio2==card.time_type" value="DATE_TYPE_FIX_TERM">
                                                      <label class="ng-binding">领取后，</label>
                                            </span>
                                            </label>

                                            <span class="dropdown_menu">
                                                <select class="form-control pull-left" :disabled="timeradio2!==card.time_type"  name="fixed_begin_term" id="fixed_begin_term">
                                                    <option value="0" :selected="card.fixed_begin_term==0">当天</option>
                                                    <option v-for="(fvo,key) in tianlist" :value="fvo" :selected="fvo==card.fixed_begin_term" >{{fvo}}天</option>
                                                </select>
                                            </span>
                                            <span class="dropdown_menu" style="padding-top:4px">生效</span>
                                            <span class="dropdown_menu" style="padding-top:4px">，有效天数</span>
                                            <span class="dropdown_menu">
                                                <select class="form-control pull-left" name="fixed_term" id="fixed_term" :disabled="timeradio2!==card.time_type">
                                                    <option v-for="(vos,key) in tianlist" :value="vos" :selected="vos==card.fixed_term">{{vos}}天</option>
                                                </select>
                                            </span>

                                            <span class="dropdown_menu">
                                                <input type="text" class="form-control pull-left" :disabled="timeradio2!==card.time_type" name='end_timestamp' placeholder="统一过期时间" id="end_timestamp" :value="card.end_timestamp">
                                            </span>
                                            <span class="" style="padding-top:4px">日统一过期</span>

                                        </div>

                                    </div>
                                </div>


                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">库存：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <input type="text"  class="form-control" name="quantity"  id="quantity" :value="card.stocks">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">使用提醒：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <input type="text" class="form-control" name="notice" id="notice" onclick="tex('notice','titleCount','18');" :value="isshuju.notice">
                                        <div class="help-block" id="titleCount"> </div>
                                        <div class="help-block">使用提醒,字数上限为16个汉字。 </div>
                                    </div>

                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">使用说明：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <input type="text" class="form-control" name="description"  id="description" onclick="tex('description','desCount','1024');" :value="isshuju.description">

                                        <div class="help-block" id="desCount"> </div>
                                        <div class="help-block">使用说明,字数上限为1024个汉字。 </div>
                                    </div>

                                </div>

                                <h4  class="card_title_detail">优惠详情</h4>
                                <div id="yh-jieshao" class=" yh-type" v-show="yh_jieshao">
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">卡券优惠详情：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                        <div class="col-sm-9 col-xs-12" style="padding-top: 6px;">
                                            <textarea name="conten" id="conten" class="s" placeholder="填写优惠具体信息" style="width: 100%;height: 100px;padding: 10px;" >{{card.conten}}</textarea>
                                        </div>
                                    </div>
                                </div>
                                <div id="yh-money" class="yh-money" v-show="yh_money">
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">起用金额：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                        <div class="col-sm-9 col-xs-12 coupon-color">
                                            <input type="text" class="form-control s" name="least_cost"  id="least_cost" :value="card.least_cost">
                                            <div class="help-block col-sm-12 col-xs-12" style="padding: 0;">例：满10(起用金额)减1(减免金额)。  </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">减免金额：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                        <div class="col-sm-9 col-xs-12 coupon-color">
                                            <input type="text" class="form-control s" name="reduce_cost"  id="reduce_cost" :value="card.reduce_cost">
                                            <div class="help-block">减免金额必须小于 起用金额。最小值为0.01。 </div>

                                        </div>
                                    </div>
                                </div>

                                <div  class=" form-group m-bt-0">
                                    <div  class="SildeAreaTitle">系统已为您完成优惠券其他基础信息设置
                                        <p class="areaShowHide">
                                            <span >展开</span>
                                            <i class=" glyphicon glyphicon-chevron-up"></i>
                                        </p>
                                    </div>
                                    <div class="card_info_box"style="display: none;">

                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">商家名称：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                            <div class="col-sm-9 col-xs-12">
                                                <input type="text" class="form-control" name="brand_name" id="brand_name" v-model="brand_name"  oninput="binding('brand_name','商家名称')" onchange="tex('brand_name','brand','12');">
                                                <div class="help-block" id="brand"> </div>
                                                <div class="help-block">商家名称,字数上限为12个汉字。 </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">卡券LOGO：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                            <div class="col-sm-10">
                                                <div class="ng-scope" style="position: relative;">
                                                    <span class="btn btn-default">上传LOGO</span>
                                                    <input type="file" id="logopic" value=""  onchange="upload('logopic', 'file')" />
                                                    <input type="hidden" name="logo_url" id="logo_url" :value="logopic">
                                                </div>
                                                <div class="help-block">建议300*300像素 格式为PNG、JPG、JPEG 。 </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">客服电话：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                            <div class="col-sm-9 col-xs-12 coupon-color">
                                                <input type="text" class="form-control" name="service_phone" id="service_phone"  :value="service_phone">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">封面摘要：</label>
                                            <div class="col-sm-9 col-xs-12 coupon-color">
                                                <input type="text" class="form-control" v-model="abstract" name="advanced_info[abstract][abstract]" id="coverAbstract"   value=""  placeholder="券封面摘要，配合图片写些营销文案，来吸引消费者" style="width: 80%;" onclick="binding('coverAbstract','商家名称')" onchange="tex('coverAbstract','coverAbstracttext','9');">

                                                <div class="help-block" id="coverAbstracttext"> </div>
                                                <p class="tipsInfo"> 封面摘要,字数上限为8个汉字</p>

                                            </div>
                                        </div>
                                        <div class="form-horizontal" data-layout="horizontal">
                                            <div class="form-group">
                                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">封面图片：</label>
                                                <div class="col-sm-9">
                                                    <div class="ant-upload ant-upload-select ant-upload-select-picture-card ">

                                                        <div class="ant-upload-list-item-info" v-show="isiconimg" id="fimg">
                                                            <div class="ant-upload ant-upload-select ant-upload-select-picture-card upload-v-img">
                                                                <img src="" alt="" class="img" :src="card.icon_url_list">
                                                                <i class="icon-close anticon-delete coverImgDel glyphicon glyphicon-remove-circle" data-ref="v-img-file" style=" left: 44%; "></i>

                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="ng-scope" style="position: relative;">
                                                        <span class="btn btn-default">上传图片</span>
                                                        <input type="file" id="img" value=""  onchange="uploads('img','file','fimg')"/>
                                                        <input type="hidden"  name="advanced_info[abstract][icon_url_list]" id="logopic-upload" required  value="" >

                                                    </div>
                                                    <p class="tipsInfo"> 非必填项，图片进行适当设计，建议尺寸850px*350px，选择与券内容相关的图片，仅支持JPG、JPEG、PNG图片文件，且文件小于2M</p>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="form-group">
                                            <div class="form-group">
                                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">图文介绍：</label>


                                                <div class="col-sm-9 ">
                                                    <p class="tipsInfo"> 非必填项，图片进行适当设计，建议尺寸850px*350px，选择与券内容相关的图片，仅支持JPG、JPEG、PNG图片文件，且文件小于2M</p>

                                                    <div class="frm_controls frm_vertical_lh">

                                                        <div class="brand_item">
                                                            <div class="imagetxts"  v-for="(v,i) in imglist">
                                                                <div class="ant-upload-list-item-info" v-show="isimage_url">
                                                                    <img src=""  class="imageShow" :src="v.image_url">
                                                                    <i class="icon-close anticon-delete imgTxtDel glyphicon glyphicon-remove-circle"></i>
                                                                </div>
                                                                <div>
                                                                    <input type="hidden" value class="cardTextImages_id valid" >
                                                                    <input type="hidden" value class="wechatImage valid" >
                                                                    <input type="hidden" name="advanced_info[text_image_list][image_url][]"  class="image valid" :value="v.image_url">
                                                                    <input type="file" class="imageTxtFile valid" value style="display:none;" >
                                                                </div>
                                                                <div class="upImage">
                                                                    <i class="icon-picture"></i>
                                                                    上传图片
                                                                    <div class="deluplod" v-on:click="deleteNode(i)" v-show="isdelimg">
                                                                        <i class="icon-close glyphicon glyphicon-remove-circle"></i>
                                                                    </div>
                                                                </div>
                                                                <div>
                                                                    <textarea class="imageTxt-txt form-control valid" name="advanced_info[text_image_list][text][]" placeholder="图文内容建议上传商品、服务、环境等优质图片，并辅之以简单描述" maxlength="170"  style=" width: 370px;">{{v.text}}</textarea>
                                                                </div>


                                                            </div>
                                                            <div class="adduplod addImageTxt" v-on:click="addNode()" v-show="isaddimg">
                                                                添加图文
                                                            </div>

                                                        </div>
                                                    </div>

                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>


                                <div id="yh-discount" class=" yh-type" v-show="yh_discount">
                                    <div class="form-group">
                                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">折扣：<span class="glyphicon glyphicon-asterisk glyphicon-tip"></span></label>
                                        <div class="col-sm-9 col-xs-12 coupon-color">
                                            <input type="text" class="form-control s" name="discount" id="discount" placeholder="例如：填70就是七折" :value="card.discount">
                                        </div>
                                    </div>
                                </div>
                                <div style="text-align: center">
                                    <button type="button" class="btn btn-primary" id="editbtn">保存到草稿箱</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                {include file='public/footer'/}
            </div>
        </div>
    </div>
</section>
</body>
<script src="__STATIC_URL__/static/js/vue.js"></script>
<script src="__STATIC_URL__/static/js/bootstrapSwitch.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/vue/weixin_deitcardus.js"></script>


<script>
    // 上传图片
    $(".brand_item").delegate('.upImage', "click", function() {
        var $parent = $(this).closest(".imagetxts");
        var $file = $parent.find(".imageTxtFile");
        $file.click();
        console.log(22,$file);
    });

    // 图片上传
    $(".brand_item").delegate('.imageTxtFile', "change", function() {
        var $parent = $(this).closest(".imagetxts");
        var index = $parent.attr("data-index");
        var formData = new FormData();
        var file = "file";
        formData.append('file', $(this)[0].files[0]);
        formData.append('other',file);

        console.log(123);
        $.ajax({
            url: "{:url('uploads/upload')}",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,

        }).done(function (res) {
            console.log(res);
            $parent.find(".deluplod").show();
            $parent.find(".imageShow").parent().show();
            $parent.find(".imageShow").attr("src", res.pic);
            $parent.find(".upImage").hide();
            if (res.code == 0) {
                $parent.find(".wechatImage").val(res.pic);
                $parent.find(".image").val(res.pic);
            } else {
                layer.msg('图片上传失败');
                imgRemoveStyle($parent);
            }
        }).fail(function (res) {
            alert("上传失败")
        });
    });


</script>

<script>
    function upload(file,name) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other',file);
        $.ajax({
            url: "{:url('uploads/upload')}",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            $("."+file).attr("src",res.pic);
            $("#logo_url").val(res.pic);

        }).fail(function (res) {
            alert("上传失败")
        });
    }
    function uploads(file,name,id) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other',file);
        $.ajax({
            url: "{:url('uploads/upload')}",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            $("."+file).attr("src",res.pic);
            $("#logopic-upload").val(res.pic);

            $("#"+id).attr("style","display:block");

            $(".fengmian_img_dom").attr("src",res.pic);
            $(".fengmian_img_parent").removeClass("hide");

        }).fail(function (res) {
            alert("上传失败")
        });
    }

</script>
<script src="__STATIC_URL__/static/laydate/laydate.js"></script>
<script>
    var laydate = laydate;
    var date = new Date();
    var year = parseInt(date.getFullYear());
    var month = parseInt(date.getMonth())+1;
    var day = parseInt(date.getDate());
    var H = parseInt(date.getHours());
    var M =parseInt( date.getMinutes());
    var S = parseInt(date.getSeconds());
    if(month<10){
        month = "0"+month;
    }
    if(day<10){
        day = "0"+day;
    }
    var min = year+"-"+month+"-"+day +" "+ H +':'+ M +':'+S;
    console.log(min);
    var date = {
        type: 'datetime',
        min:min,
        range:'-',
        trigger: 'click'
    };
    date.elem = '#starttime';
    laydate.render(date);
</script>
<script>
    laydate.render({
        elem: '#end_timestamp',
        type: 'datetime',
        range: false

    });
</script>


</html>
